@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <form data-validate="parsley" method="post" enctype="multipart/form-data">
            {!! csrf_field() !!}
            <section class="panel panel-default">
                <header class="panel-heading">
                    {{ !empty($pageLabel)?$pageLabels[$pageLabel]:'' }} {{ $frame['title'] }}
                    <a href="{{ route('admin.page.pageinfo') }}" class="btn btn-xs btn-default pull-right">信息列表</a>
                </header>
                <div class="panel-body">
                    <p class="text-muted">如需设置企业信息模版页面,请前往文件夹:<span
                                class="text-info">{{ pathinfo(config('app.page_theme'))['dirname'] }}</span>,按指定格式(<span
                                class="text-info">{{ pathinfo(config('app.page_theme'))['basename'] }}</span>)添加模版文件!
                    </p>
                    <div class="form-group">
                        <label>信息名称</label>
                        <input type="text" class="form-control parsley-validated" data-required="true" name="name"
                               placeholder="请填写信息名称">
                    </div>
                    <div class="form-group pull-in clearfix">
                        <div class="col-sm-4">
                            <label>信息图片</label>
                            <div class="clearfix"></div>
                            <input type="file" class="filestyle" data-icon="false" data-classButton="btn btn-default"
                                   name="image"
                                   data-classInput="form-control inline v-middle input-s">
                        </div>
                        <div class="col-sm-3">
                            <label>所属模块</label>
                            <div class="clearfix"></div>
                            <select style="width:100%" class="chosen-select" name="label">
                                @foreach( $pageLabels as $id => $name)
                                    <option value="{{ $id }}" {{ !empty($pageLabel) && $id==$pageLabel?'selected':'' }}>{{ $name }}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-3">
                            <label>信息模版</label>
                            <div class="clearfix"></div>
                            <select style="width:100%" class="chosen-select" name="theme">
                                @foreach( $pageThemes as $theme )
                                    <option value="{{ $theme }}" {{ !empty($pageTheme) && $theme == $pageTheme?'selected':'' }} >{{ $theme }}</option>
                                @endforeach
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <label>访问浏览量</label>
                            <input type="text" class="form-control parsley-validated" data-required="true"
                                   name="page_view" value="0" placeholder="请设置页面访问量">
                        </div>
                    </div>
                    <div class="form-group pull-in clearfix">
                        <div class="col-sm-8">
                            <label>标签</label>
                            <input name="tag" id="tagsinput_tag" class="tagsinput" type="text"
                                   value="{{ $tag }}"/>
                        </div>
                        <div class="col-sm-4">
                            <label>信息排序</label>
                            <div class="clearfix"></div>
                            <input class="slider slider-horizontal form-control" type="text" value="10" name="xindex"
                                   data-slider-min="1" data-slider-max="100" data-slider-step="1" data-slider-value="10"
                                   data-slider-orientation="horizontal">
                        </div>
                    </div>
                    <div class="form-group">
                        <label>摘要信息</label>
                        <textarea class="form-control" name="simpledescribe"
                                  placeholder="企业信息摘要 (如未填写,则引用详细信息中的前部分信息)"></textarea>
                    </div>
                    <div class="form-group">
                        <label>详细信息</label>
                        <div id="describe" name="describe" type="text/plain" style="width: 100%;height: 300px;"></div>
                    </div>
                    <div class="form-group">
                        <label>跳转网址
                            <small class="text-small">如填入网址,当访问本信息的超链接时,即跳转至下方输入的网址!</small>
                        </label>
                        <input type="text" class="form-control " name="jump_url">
                    </div>
                    <div class="form-group pull-in clearfix">
                        <div class="col-sm-3">
                            <input type="text"
                                   class="form-control"
                                   name="extend_field_1"
                                   placeholder="拓展信息1">
                        </div>
                        <div class="col-sm-3">
                            <input type="text"
                                   class="form-control"
                                   name="extend_field_2"
                                   placeholder="拓展信息2">
                        </div>
                        <div class="col-sm-3">
                            <input type="text"
                                   class="form-control"
                                   name="extend_field_3"
                                   placeholder="拓展信息3">
                        </div>
                        <div class="col-sm-3">
                            <input type="text"
                                   class="form-control"
                                   name="extend_field_4"
                                   placeholder="拓展信息4">
                        </div>
                    </div>
                    <div class="checkbox i-checks">
                        <label>
                            <input type="checkbox" name="status" checked><i></i> 勾选此项,即开启此信息页面
                        </label>
                    </div>
                </div>
                <footer class="panel-footer text-right bg-light lter">
                    <button type="submit" class="btn btn-success btn-s-xs">保存</button>
                </footer>
            </section>
        </form>
    </div>
@endsection

@section('css')
    <link rel="stylesheet" href="/public/theme/js/chosen/chosen.css" type="text/css"/>
    <link rel="stylesheet" href="/public/theme/js/slider/slider.css" type="text/css"/>
@endsection

@section('js')
    <!-- slider -->
    <script src="/public/theme/js/slider/bootstrap-slider.js"></script>
    <!-- uediter -->
    <script src="/public/laravel-u-editor/ueditor.config.js"></script>
    <script src="/public/laravel-u-editor/ueditor.all.min.js"></script>
    <script src="/public/laravel-u-editor/lang/zh-cn/zh-cn.js"></script>
    <!-- Chosen -->
    <script src="/public/theme/js/chosen/chosen.jquery.min.js"></script>
    <!-- parsley -->
    <script src="/public/theme/js/parsley/parsley.min.js"></script>
    <script src="/public/theme/js/parsley/parsley.extend.js"></script>
    <!-- tagsinput -->
    <script src="/public/theme/js/tagsinput/bootstrap-switch.js"></script>
    <script src="/public/theme/js/tagsinput/jquery.tagsinput.js"></script>
    <script src="/public/theme/js/tagsinput/form-component.js"></script>
    <!-- file input -->
    <script src="/public/theme/js/file-input/bootstrap-filestyle.min.js"></script>
    <script>
        var uea = UE.getEditor('describe');
    </script>
@endsection